import request from '@/utils/request'

/**
 * 获取商品素材列表
 */
export function getMaterialListByGoodId(goodsId) {
  return request({
    url: '/material/thirdGoodMaterial/getMaterialListByGoodId',
    method: 'get',
    params: { goodsId }
  })
}

/**
 * 删除素材表数据
 */
export function deleteGoodsMaterialById(thirdGoodMaterialId) {
  return request({
    url: '/material/thirdGoodMaterial/delete',
    method: 'get',
    params: { thirdGoodMaterialId }
  })
}

/**
 * 清空素材表数据
 */
export function clearGoodsMaterial(shopId, goodsId) {
  return request({
    url: '/material/thirdGoodMaterial/deleteAllGoodsMaterial',
    method: 'get',
    params: { shopId: shopId, goodsId: goodsId }
  })
}

/**
 * 更新素材
 */
export function renewGoodMaterial(shopId, goodsId) {
  return request({
    url: '/material/thirdGoodMaterial/doRenewGoodMaterial',
    method: 'get',
    params: { shopId: shopId, goodsId: goodsId }
  })
}
